package leducHoldem.Data;

import java.io.Serializable;

public class Card implements Comparable<Card>, Serializable{
	
	private static final long serialVersionUID = 1L;
	
	byte value = 0;
	
	public Card(byte value) {
		this.value = value;
	}
	
	public Card(Card card) {
		this.value = card.value;
	}

	@Override
	public int compareTo(Card card) {
		if(card.value < this.value)
			return 1;
		else if(card.value == this.value)
			return 0;
		else
			return -1;
	}
	
	@Override
	public String toString() {
		switch (value) {
		case 1:
			return "J";
		case 2:
			return "Q";
		case 3:
			return "K";
		default:
			return null;
		}
	}
	
	public boolean equals(Card card) {
		
		if(card.value == this.value) {
			return true;
		}
		
		return false;
	}

}
